package com.tianpengtech.front.web.common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

/**
 * Templates constant intercept
 * @author Delicate
 */
public class WebsiteInterceptor implements Interceptor {
    public void intercept(Invocation i) {
        //todo set Website field to JF templates from web_config.properties
        i.invoke();
        Controller controller = i.getController();
        String host = controller.getRequest().getRemoteHost();
        int port = controller.getRequest().getLocalPort();
        controller.setAttr("host", "http://106.14.177.36");
        controller.setAttr("port", port);
    }
}
